package com.wom.gui;

final class FPSCounter{
	public long lastTime=0;
	public int frames=0;
	
	public void startCounter(){
		lastTime=System.nanoTime();
		frames=0;
	}
	
	public void calculateFPS(){
		
		
		
		
		// count up a frame
		frames++;
		
		// check if the difference is  larger than or equal to a second
		
		if(System.nanoTime()-lastTime>1000000000L){
			GameApplet.fps=frames;
			frames=0;
			lastTime=System.nanoTime();
		}
		
		
	}
}
	